package chaoyue.study.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;

import java.util.concurrent.Executor;

@EnableAspectJAutoProxy(exposeProxy = true)
@EnableAsync // 开启异步注解支持
@Configuration
public class AsyncConfig implements AsyncConfigurer {

    /**
     * 可以手动指定Async需要使用的线程池
     */
    @Override
    public Executor getAsyncExecutor() {
        return AsyncConfigurer.super.getAsyncExecutor();
    }
}
